package com.fit.networkShop.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.fit.networkShop.interfaces.Purchase;

public class PurchasesBean implements Purchases {
	private Map<String, Purchase> purchases = new HashMap<String, Purchase>();
	
	public Collection<Purchase> retrieve() {
		return purchases.values();
	}

	public Purchase save(Purchase purchase) {
		return purchases.put(purchase.getId(), purchase);
	}
	
	public Purchase retrieveSinglePurchase(String id) {
		return purchases.get(id);
	}
}
